fetcher: Log failures into journal
authorColin Walters <walters@verbum.org>
Thu, 23 Feb 2017 14:24:58 +0000 (09:24 -0500)
committerAtomic Bot <atomic-devel@projectatomic.io>
Fri, 24 Feb 2017 22:30:24 +0000 (22:30 +0000)
commit2c326d705eec5f379a01ba2b584986548473d6c2
tree6f96a37e0e4fbdc4481a19b1bdcc5ef2fc61fbd5
parentcee57a0268334d51cd312c6cdcf367bedfd3e30d
fetcher: Log failures into journal

Particularly when HTTP requests fail, I really want a lot more information.
We could theoretically stuff it into the `GError` message field, but
that gets ugly *fast*.

Using the systemd journal allows us to log things in a structured fashion.
Right now e.g. rpm-ostree won't be aware of this additional information,
but I think we could teach it to be down the line.

In the short term, users can learn to find it from `systemctl status rpm-ostreed`
or `journalctl -b -r -u rpm-ostreed`, etc.

One thing I'd like to do next is log successful fetches of e.g. commit objects
as well with more information about the originating server (things like the
final URL if we were redirected, did we use TLS pinning, what was the negotiated
TLS version+cipher, etc).

Closes: #708
Approved by: jlebon
src/libostree/ostree-fetcher-curl.c
src/libostree/ostree-fetcher-soup.c
src/libostree/ostree-fetcher-util.c
src/libostree/ostree-fetcher-util.h
src/libostree/ostree-fetcher.h
src/libostree/ostree-repo-pull.c